home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7744 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: news.lpr.carel.fi!usenet
  2. From: Ari Lukumies <aril@cmt.lpr.mail.carel.fi>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: LINK Problem with Microsoft C++ 1.52  Help!
  5. Date: Mon, 19 Feb 1996 16:47:55 +0200
  6. Organization: Carelcomp Forest
  7. Message-ID: <31288D9B.5E5D@cmt.lpr.mail.carel.fi>
  8. References: <3125CDB0.614B@access.ch>
  9. NNTP-Posting-Host: renoir.cclahti.carel.fi
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0b6a (WinNT; I)
  14.  
  15. Robert Wellinger wrote:
  16. > Help! Help! I need help!
  17. > I'm working with Microsoft Visual C++ 1.52 under Windows 3.11.
  18. > When I compile the my project (it isn't small) there is always this
  19. > error:
  20. > LINK Error L2028"
  21. > automatic data segment plus heap exceed 64K
  22. > Data declared in DGROUP
  23. >         The size of the heap specified in the HEAPSIZE statement in the
  24. > module-definition (.DEF) file
  25. >         The size of the stack specified in either the /STACK option or
  26. > the STACKSIZE statement in the .DEF file
  27. > Reduce near-data allocation, heap size, or stack size.
  28. > But I can't reduce the HEAPSIZE and the STACKSIZE (the project is to
  29. > big) and I need a lot
  30. > of global (static) variables.
  31. > If you can help me send E-MAIL to "rwellinger@access.ch"
  32.  
  33. If you haven't already done so, switch to large memory model. Then, in the compiler 
  34. options, specify smaller data threshold, eg. /Gt2. This will place all your global data 
  35. sizeof(which) >= 2 bytes to a far data segment and not into the DGROUP default. (This 
  36. also applies to string literals such as "Hello, world!") However, you still cannot have 
  37. more than 64kB of global data per compilation unit (ie. source module). If your 
  38. compilation units have too much data, try breaking them into smaller pieces and use 
  39. 'extern'.
  40.  
  41. HTH,
  42.  AriL
  43. -- 
  44. All my opinions are mine and mine alone.
  45.